import pymysql

conn = pymysql.connect(host="localhost",port=3306,user="root",password="zxc123!!",database="test_7_11",charset="utf8")

cursor = conn.cursor()

cursor.execute("select * from emp")

res1 = cursor.fetchone()
print(res1)

cursor.rownumber = 2
res2 = cursor.fetchmany(2)
print(res2)

cursor.rownumber = 0
res3 = cursor.fetchall()
print(res3)
print(len(res3))
print(conn.affected_rows())

cursor.close()
conn.close()